package com.mtk.launcher;

import android.app.Application;

import com.mtk.launcher.util.CrashHandler;
import com.mtk.launcher.util.shared.SharedManagerModel;

import org.litepal.LitePal;

public class MyApplicaiton extends Application {

    SharedManagerModel sharedPerManager;
    private static MyApplicaiton instance;


    public static MyApplicaiton getInstance() {
        return instance;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        instance = this;
        sharedPerManager = new SharedManagerModel(this, "LAUNCHER_SHARE");
        LitePal.initialize(MyApplicaiton.this);
        //初始化CrashHandler
        CrashHandler.getInstance();
    }

    public void saveData(String key, Object data) {
        sharedPerManager.saveData(key, data);
    }

    public Object getData(String key, Object defaultObject) {
        return sharedPerManager.getData(key, defaultObject);
    }

}
